


use RFS_master_data, clear

   * save the p-values for testing equality between coefficients:
 	 mat UALL = J(5,1,1)
 
 		 local gg = 1

cap drop yy xx*
 gen yy = N_aver
 gen xx = size
 gen xxActive = activeZ  
 qui winsor2 xx , replace cuts(1 99)
  qui winsor2 yy , replace cuts(1 99)
 
 cap estimates drop f*
  
 	reghdfe yy  i.agency#c.xx  if xxActive == 1   , absorb(st0_date#instrumentid#agency      )    cluster(call   st0_date)
  estimates store ff1
   test 1.agency#c.xx = 0.agency#c.xx
   	    local gg2 = r(p)
        mat UALL[1,`gg'] = `gg2'
   
 	reghdfe yy  i.agency#c.xx    if xxActive == 1 , absorb(st0_date#instrumentid#agency  call      )    cluster(call   st0_date)
  estimates store ff2
   test 1.agency#c.xx = 0.agency#c.xx
     local gg2 = r(p)
        mat UALL[2,`gg'] = `gg2'
   
 	reghdfe yy  i.agency#c.xx   if xxActive == 1 , absorb(st0_date#instrumentid#agency  call coun#agency     )    cluster(call   st0_date)
  estimates store ff3
   test 1.agency#c.xx = 0.agency#c.xx
     local gg2 = r(p)
        mat UALL[3,`gg'] = `gg2'

 	reghdfe yy  i.agency#c.xx   if xxActive == 1   , absorb(st0_date#instrumentid#agency mm#call st0_date#coun#agency     )    cluster(call   st0_date)
  estimates store ff4
   test 1.agency#c.xx = 0.agency#c.xx
     local gg2 = r(p)
        mat UALL[4,`gg'] = `gg2'

   
 	reghdfe yy  i.agency#c.xx   if xxActive == 1   , absorb(st0_date#instrumentid#agency mm#call st0_date#coun#agency call#coun  )    cluster(call   st0_date)
  estimates store ff5
   test 1.agency#c.xx = 0.agency#c.xx
     local gg2 = r(p)
        mat UALL[5,`gg'] = `gg2'
 
  esttab ff*    ///
 , star("*" 0.1 "**" 0.05 "***" 0.01) b(%10.3f) t(%10.2f) scalars(N r2) sfmt(%10.3f)   replace

 
    esttab ff* using "RFSAgencyTrades.tex"  ///
  , star("*" 0.1 "**" 0.05 "***" 0.01) b(%10.3f) t(%10.2f) scalars(N r2) sfmt(%10.3f)   replace

      mat list UALL
   